employees = {
    101: {
        "name": "Alice",
        "age": 30,
        "gender": "Female",
        "position": "Data Scientist",
        "team": "Research",
        "salary_history": [70000, 80000, 90000]
    },
     # 更多员工数据...
}

#新增一个员工的信息到`employees`字典中
employees[102] = {"name": "Bob", "age": 28, "gender": "Male", "position": "Software Engineer", "team": "Development", "salary_history": [60000, 65000, 70000]}

#删除一个指定的员工的信息
del employees[102]

#更新员工101的年龄至31
employees[101]["age"] = 31

#增加员工101薪资历史中的最新薪资至95000
employees[101]["salary_history"].append(95000)

#计算员工101的平均薪资
# avg_salary = sum(employees[101]["salary_history"])/len(employees[101]['salary_history'])
# print(avg_salary)

#找出所有年龄大于25岁的员工的姓名和ID
# for i in employees.keys():
#     if employees[i]["age"]>25:
#         print(f"{employees[i]["name"]} {i}")

#对`employees`中的每个员工，添加'bonus'键至其字典中，其中值是最新薪资的10%
# for i in employees.keys():
#     employees[i]["bonus"]=int(employees[i]["salary_history"][-1]*0.1)
# print(employees[101])

#将员工101的职位更新为"Senior Data Scientist"
# employees[101]['position'] = "Senior Data Scientist"

#从员工的信息中移除`gender`键
# for i in employees.keys():
#     del employees[i]["gender"]
# print(employees)

#创建一个新的嵌套字典，该字典仅包含员工的`name`和`position`
# employees1={1:{"name":"张三","position":"码农"}}